package com.lifa.controller;

import com.lifa.dao.XiaoFeiMXTableDao;
import com.lifa.entity.XiaoFeiMXTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;
/**
 * 123
 */
@Controller
@RequestMapping("/XiaoFeiMXTable")
@Scope("prototype")
public class XiaoFeiMXTableController {
    @Autowired
    private XiaoFeiMXTableDao xiaoFeiMXTableDao;


    @RequestMapping("/xfmxtable")
    @ResponseBody
    public Map<String,Object> danjutable(String xiaofeitabledanhao, int offset, int limit){
        Map<String,Object> map = new HashMap<String, Object>();

        //System.out.print(id);
        map.put("rows",xiaoFeiMXTableDao.query(xiaofeitabledanhao,offset,limit));
        map.put("total",xiaoFeiMXTableDao.getTotalCount(xiaofeitabledanhao));
        return map;
    }
    @RequestMapping("/tianjia")
    @ResponseBody
    public int tinajia(XiaoFeiMXTable xiaoFeiMXTable){
        return xiaoFeiMXTableDao.tianjia(xiaoFeiMXTable);
    }
}
